﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Docs.Service.Extension
{
    public static class HtmlHelper
    {
        public static IHtmlString DisplayCode(this System.Web.Mvc.HtmlHelper helper, String code, String language)
        {
            System.Web.Mvc.MvcHtmlString html;
            switch (language.ToLower())
            {
                case "c#":
                    Manoli.Utils.CSharpFormat.CSharpFormat cs = new Manoli.Utils.CSharpFormat.CSharpFormat();
                    html = new System.Web.Mvc.MvcHtmlString(cs.FormatCode(code));
                    break;
                default:
                    html = new System.Web.Mvc.MvcHtmlString(String.Empty);
                    break;
            }
            return html;
        }
    }
}